//
//  VCQrCode.swift
//  AirlineReservation
//
//  Created by Kevin on 2020/2/19.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VCQrCode: VCBase {
    
    // 二维码信息
    public var message:String?
    // 公司名称
    public var companyName:String?
    
    private lazy var qrCodeView:QrCodeView = {
        let ui = QrCodeView()
        let uiY = realHeight + MARGIN35
        let uiW = SCREEN_WIDTH - MARGIN * 2
        let uiH = SCREEN_WIDTH + MARGIN30
        ui.layer.cornerRadius = 8
        ui.backgroundColor = UIColor.white
        ui.frame = CGRect(x: MARGIN, y: uiY, width: uiW, height: uiH)
        return ui
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        init_view()
        init_data()
    }
}

extension VCQrCode {
    
    private func init_data() -> Void {
        qrCodeView.resetQrMessage = message
        qrCodeView.resetCompanyName = companyName
    }
    
    private func init_view() -> Void {
        view.addSubview(qrCodeView)
    }
}
